import 'package:flutter/material.dart';
import 'package:wheel_of_fortune/http/api.dart';
import 'package:wheel_of_fortune/wheel_of_fortune_page.dart';

import 'utils/utils.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  getData() async {
    final op = BaseOptions();
    op.headers['content-Type'] = 'application/x-www-form-urlencoded';
    final data = await Dio(op).post(
      'https://devapi.fortunepay.com.ph/v1/customer/verifyloginpin',
      data: {
        'dial_code': '+63',
        'phone_number': '9088950793',
        'login_pin': '1111',
        'company_id': '4bf735e97269421a80b82359e7dc2288',
      },
    );
    print(data);
  }

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    getData();
    AddressHelper.getProvinceList(context);
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        primaryColor: mainColor,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: Builder(builder: (c) {
        final size = MediaQuery.of(c).size;
        Utils.setScreenSize(size);
        Utils.setScreenWidth(size.width);
        Utils.setScreenHeight(size.height);
        return WheelOfFortunePage();
      }),
    );
  }
}
